package com.BoobooBot;

import com.skype.ChatMessage;
import com.skype.ChatMessageListener;
import com.skype.SkypeException;

public class MyChatMessageListener implements ChatMessageListener {

	CommandHandler ch;

	public MyChatMessageListener(CommandHandler ch) {
		this.ch = ch;
	}

	@Override
	public void chatMessageReceived(ChatMessage c) throws SkypeException {
		// System.out.println("MESSAGE RECEIVED");
		if (c.getContent().startsWith("!")) {
			ch.executeCommand(c);
		}
	}

	@Override
	public void chatMessageSent(ChatMessage c) throws SkypeException {
		// System.out.println("MESSAGE SENT");
		if (c.getContent().startsWith("!")) {
			ch.executeCommand(c);
		}
	}
}
